using System;
using System.Linq.Expressions;
using System.Threading.Tasks;
using OrderService.Domain.Models;
using SharedKernel.Infrastructure.Repositories;

namespace OrderService.Domain.Repositories
{
    /// <summary>
    /// 订单仓储接口
    /// </summary>
    public interface IOrderRepository : ISqlSugarRepository<Order, Guid>
    {
        /// <summary>
        /// 根据订单编号获取订单
        /// </summary>
        /// <param name="orderNumber">订单编号</param>
        /// <returns>订单实体</returns>
        Task<Order> GetByOrderNumberAsync(string orderNumber);

        /// <summary>
        /// 根据条件获取订单
        /// </summary>
        /// <param name="condition">查询条件</param>
        /// <returns>订单查询结果</returns>
        IQueryable<Order> GetByCondition(Expression<Func<Order, bool>> condition);
    }
}